﻿namespace ContainerVariations.Common
{
    public class NameAnalysis
    {
        private readonly string _name;
        private readonly INameDataLookupService _lookupService;

        public delegate NameAnalysis Factory(string name);

        public NameAnalysis(string name, INameDataLookupService lookupService)
        {
            _name = name;
            _lookupService = lookupService;
        }
    }

    public interface INameDataLookupService
    {
        INameData Lookup(string name);
    }

    public class NameDataLookupService : INameDataLookupService
    {
        public INameData Lookup(string name)
        {
            return new NameData(name);
        }
    }

    public interface INameData
    {
        string Name { get; }
    }

    public class NameData : INameData
    {
        private readonly string _name;

        public NameData(string name)
        {
            _name = name;
        }

        public string Name
        {
            get 
            {
                return _name;
            }
        }
    }
}